<template>
    <div class='router-div'>
      <button @click="getData">获取</button>
      <div v-for="(item, index) in this.totalPage">
        <router-link v-bind="{to:'/word/part/' + index }">
          <mt-cell :title="item" value=""></mt-cell>
        </router-link>
      </div>
    </div>
</template>

<script>
    import common from "../../data/common"
    export default {
        name: "StudyPartList",
        data() {
          return {
            currPage:0,
            totalPage:0,
            tableData:""
          };
        },
        methods: {
          getData(){
            var url = common.apidomain + "/admin/select"
              + "?tableName=part"
              +"&currPage=" + this.currPage
            this.$http.get(url).then(ret=>{
              this.tableData = ret.body.data;
              this.totalPage = parseInt(this.tableData.total/100 + 1);
            },ret=>{
              this.$message(ret.body.msg);
            })
          }
        },
      created() {
          this.getData();
      }
    }
</script>

<style scoped>

</style>
